<html>
<body>
Reports methods and method hierarchies that always return the same constant.
<p>
The inspection works differently in batch-mode
  (from <b>Code | Inspect Code</b> or <b>Code | Analyze Code | Run Inspection by Name</b>)
  and on-the-fly in the editor:
<ul>
  <li>In batch-mode, the inspection reports methods and method hierarchies that always
    return the same constant.</li>
  <li>In the editor, the inspection only reports methods that have more than one <code>return</code>
    statement, do not have super methods, and cannot be overridden. If a method overrides or
    implements a method, a contract may require it to return a specific constant, but at the
    same time, we may want to have several exit points. If a method can be overridden, it is
    possible that a different value will be returned in subclasses.
  </li>
</ul>
<p><b>Example:</b></p>
<pre><code>
  class X {
                // Warn only in batch-mode:
    int xxx() { // Method 'xxx()' and all its overriding methods always return '0'
      return 0;
    }
  }

  class Y extends X {
    @Override
    int xxx() {
        return 0;
    }

                // Warn only in batch-mode:
    int yyy() { // Method 'yyy()' always returns '0'
        return 0;
    }

                                  // Warn both in batch-mode and on-the-fly:
    final int zzz(boolean flag) { // Method 'zzz()' always returns '0'
        if (Math.random() > 0.5) {
            return 0;
        }
        return 0;
    }
  }
</code></pre>
</body>
</html>
